package com.cll.test;


import java.io.File;

import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.MultimediaInfo;

public class VodioUtils {
	public static void main(String[] args){
        File source = new File("D:\\技术资料\\尚硅谷\\尚硅谷Java大厂面试题第三季\\视频\\");
        Encoder encoder = new Encoder();
        File[] file = source.listFiles();
        long sum =0;
        for (File file2 : file) {
            try {
                 MultimediaInfo m = encoder.getInfo(file2);
                 long ls = m.getDuration()/1000; //ls是获取到的秒数
                 sum += ls;
                 System.out.println(file2.getName() +":       "+ ls/60+"分"); // 秒数
                 if(sum/3600 > 6) {
                	 System.out.println("-----------------------");
                 }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        double sum1 = (double)sum;
        double sum2 =sum1/3600; // 转换成为了小时
        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println("共："+sum2+"小时");
    
	}
	
}
